import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<ListPageState> buildReducer() {
  return asReducer(
    <Object, Reducer<ListPageState>>{
      ListPageAction.action: _onAction,
      ListPageAction.initDatas:_initDatas
    },
  );
}

ListPageState _initDatas(ListPageState state, Action action) {
  final ListPageState newState = state.clone();
  newState.clone()..datas = action.payload;
  return newState;
}

ListPageState _onAction(ListPageState state, Action action) {
  final ListPageState newState = state.clone();
  return newState;
}
